import 'package:flame/components.dart';
import '../worlds/game/entity/SpriteAnimationParamEntity.dart';

// 游戏设置
mixin GameConfig {
  // 当前是否为调试模式
  // static bool isDebug = false;
  static bool isDebug = true;

  // 植物
  final double sunflowerHp = 50; // 太阳花生命值
  final double sunflowerGenerateSunPeriod = isDebug ? 2 : 10; // 太阳花生产阳光的时间间隔
  final int sunValue = 25; // 一个阳光的数值

  // 草坪格子
  final lawnTopLeft = Vector2(306, 100); // 左上角坐标
  final rows = 5; // 横向格子数
  final cols = 9; // 纵向格子数
  final cellSize = Vector2(96, 116); // 每个格子的大小

  // 僵尸
  final zombieSpeed = isDebug ? 30.0 : 7.0; // 行走速度
  final zombieGeneratePeriod = isDebug ? 1.0 : 12.0; // 波次生成间隔时间
  final zombieEatingPeriod = 0.1; // 吃植物间隔
  final zombieAttackPeriod = 1.0; // 啃食伤害
  final zombieMaxHp = isDebug ? 30.0 : 80.0; // 生命值

  // 顶部菜单高度
  final double menuHeight = 105;
  final double menuFixedLeft = 150.0;
  final double menuFixedRight = 100.0;
  final double menuTargetWidth = 649.0;
  final double menuFixedLeftOffset = -42.5;
  final double plantMenuOffset = 134;
  final double plantMenuButtonHeight = 86;
  final double plantMenuButtonGap = 7;
  final Vector2 nowSunPosition = Vector2(72, 86);

  // 图层优先级
  final int zombiePriority = 200; // 僵尸
  final int plantPriority = 100; // 植物
  final int shadowPriority = 50; // 阴影
  final int sunPriority = 201; // 太阳
  final int menuPriority = 999; // 菜单
  final int backgroundPriority = 1; // 背景
  final int lawnCellPriority = 800; // 草坪
  final int dragPlantShadowPriority = 1000; // 拖拽阴影
  final int shovelPriority = 999; // 铲子
  final int bulletPriority = 1500; // 铲子

  // 整个屏幕的宽高（4:3）
  static final double gameScreenWidth = 960;
  static final double gameScreenHeight = 720;

  // 全局参数
  // final double viewOffsetLeftDistance = 250.0;

  // BasicStage
  final idleZombiePositions = [
    Vector2(1330, 200),
    Vector2(1400, 400),
    Vector2(1380, 150),
    Vector2(1450, 300),
    Vector2(1490, 490),
  ];
  final idleZombieState = [
    SpriteAnimationParamEntity.zombieIdle,
    SpriteAnimationParamEntity.zombieIdle2,
    SpriteAnimationParamEntity.zombieIdle3,
    SpriteAnimationParamEntity.zombieIdle4,
  ];
  final idleZombieShadowOffset = Vector2(18, 10);
  final basicStageCameraWidthFactor = 1.7;
}
